home *** CD-ROM | disk | FTP | other *** search
- Path: access4.digex.net!not-for-mail
- From: ell@access4.digex.net (Ell)
- Newsgroups: comp.lang.c++
- Subject: Re: Destructors in functions
- Date: 16 Jan 1996 03:23:07 GMT
- Organization: The Universe
- Message-ID: <4df5mr$q92@news4.digex.net>
- References: <4d7r65$dv9@newsbf02.news.aol.com> <4de8pf$apt@nntpd2.cxo.dec.com>
- NNTP-Posting-Host: access4.digex.net
- X-Newsreader: TIN [UNIX 1.3 950824BETA PL0]
-
- Brian Hibbert (b_hibbert@csc32.enet.dec.com) wrote:
- : weatby@aol.com (Weatby) wrote:
- : >If you pass an object to a function, the language makes a bitwise copy of
- : >it, local to the function. (Assuming no copy constructor is defined.)
- : >Then, on the way out, the function calls the user-defined constructor.
- : >
- :
- : As others have pointed out, the compiler should do a memberwise copy of
- : the object. You can avoid much of this by passing a reference to the
- : object (which should not call a copy constructor).
-
- Though any class object, being assigned the reference, which has a copy
- ctor that has an argument of the reference type will have that ctor
- called.
-
- Elliott
-